﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TestAngular.Migrations
{
    public partial class DocumentAggregateRoot_Update_DocumentId : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_BasicArchivesPlanOrderPreparation_BasicArchivesPlanOrder_PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation");

            migrationBuilder.DropForeignKey(
                name: "FK_BasicArchivesProductionOrderPreparation_BasicArchivesProductionOrder_ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation");

            migrationBuilder.DropIndex(
                name: "IX_BasicArchivesProductionOrderPreparation_ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation");

            migrationBuilder.DropIndex(
                name: "IX_BasicArchivesPlanOrderPreparation_PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation");

            migrationBuilder.DropColumn(
                name: "ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation");

            migrationBuilder.DropColumn(
                name: "PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_BasicArchivesProductionOrderPreparation_ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation",
                column: "ProductionOrderId");

            migrationBuilder.CreateIndex(
                name: "IX_BasicArchivesPlanOrderPreparation_PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation",
                column: "PlanOrderId");

            migrationBuilder.AddForeignKey(
                name: "FK_BasicArchivesPlanOrderPreparation_BasicArchivesPlanOrder_PlanOrderId",
                table: "BasicArchivesPlanOrderPreparation",
                column: "PlanOrderId",
                principalTable: "BasicArchivesPlanOrder",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_BasicArchivesProductionOrderPreparation_BasicArchivesProductionOrder_ProductionOrderId",
                table: "BasicArchivesProductionOrderPreparation",
                column: "ProductionOrderId",
                principalTable: "BasicArchivesProductionOrder",
                principalColumn: "Id");
        }
    }
}
